<?php

namespace app\admin\model\validate;

use think\Validate;

class AlbumSkin extends Validate {
    protected $rule =   [
        'cate_id'  => 'require',
        //'open_id' => 'require',
        'cate_name' => 'require|max:50',
        'title' => 'require|max:125',
        'name' => 'require|max:50|unique:album_skin',
        //'music' => 'require|max:255',
        'sort' => 'number',
    ];

    protected $message  =   [
        'cate_id.require' => '分类名称不能为空',
        'cate_name.require' => '分类名称不能为空',
        'cate_name.max' => '分类名称不能超过50个字符',
        'title.require' => '标题不能为空',
        'title.max' => '标题不能超过125个字符',
        'name.require' => '皮肤名称不能为空',
        'name.max' => '皮肤名称不能超过50个字符',
        'sort.number'     => '排序必须是数字',
        //'music.require'     => '音乐不能为空',
        //'music.max'     => '音乐不能超过255个字符',
        'name.unique'     => '模板名称已经存在',
    ];

    protected $scene = [
        /*'add'  =>  ['name','theme','start_time', 'end_time', 'attention_tips', 'cover_image_url', 'sort', 'participate_num'],
        'edit'  =>  ['name','theme','start_time', 'end_time', 'attention_tips', 'cover_image_url', 'sort', 'participate_num'],*/
    ];
}